import request from '@/utils/request'

// 查询隐患上报分页
export function pageDanger(query) {
  return request({
    url: '/risk/danger/page',
    method: 'get',
    params: query,
    factoryId:true,
  })
}

// 查询隐患上报列表
export function listDanger(query) {
  return request({
    url: '/risk/danger/list',
    method: 'get',
    params: query,
    factoryId:true
  })
}

// 查询隐患上报详细
export function getDanger(id) {
  return request({
    url: '/risk/danger/info/' + id,
    method: 'get'
  })
}

// 新增隐患上报
export function addDanger(data) {
  return request({
    url: '/risk/danger',
    method: 'post',
    data: data,
    factoryId:true,
  })
}

// 修改隐患上报
export function updateDanger(data) {
  return request({
    url: '/risk/danger',
    method: 'put',
    data: data
  })
}

// 删除隐患上报
export function delDanger(data) {
  return request({
    url: '/risk/danger/remove/batch',
    method: 'delete',
    data
  })
}

// 导出隐患上报
export function exportDanger(query) {
  return request({
    url: '/risk/danger/export',
    method: 'get',
    params: query
  })
}

// 下载模板隐患上报
export function downImportTemplate() {
  return request({
    url: '/risk/danger/importTemplate',
    method: 'get'
  })
}

// 获取隐患确认列表
export function getDangerTask(data) {
  return request({
    url: '/risk/danger/getRiskDnagerTask',
    method: 'get',
    params:data,
    factoryId:true,
  })
}

// 隐患确认操作
export function dangerConfirm(data) {
  return request({
    url: 'risk/danger/confirm',
    method: 'put',
    data: data
  })
}

// 查询隐患台账 分页接口
export function pageDangerRecord(query) {
  return request({
    url: '/risk/danger/record/page',
    method: 'get',
    params: query,
    factoryId:true,
  })
}